{include file='blogpage/base/header' /}
<div class="row wrapper border-bottom white-bg page-heading">
    <div class="col-lg-10">
        <h2>站内动态</h2>
        <ol class="breadcrumb">
            <li>
                <span>主页</span>
            </li>
            <li href="friend">
                站内动态
            </li>
        </ol>
    </div>
    <div class="col-lg-2">
    </div>
</div>
<div class="wrapper wrapper-content">
    <div class="row animated fadeInRight">
        <div class="col-sm-8">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>动态发表</h5>
                </div>
                <div class="ibox-content">
                    <div class="text-center well">
                        <a data-toggle="modal" class="btn btn-primary" id="add">发表动态</a>
                    </div>
                </div>
            </div>
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>最新动态</h5>

                </div>
                {volist name='blog' id='blog'}
                <div class="social-feed-box">
                    <div class="social-avatar">
                        <a href="" class="pull-left">
                            <img alt="image" class="img-circle" src="http://q1.qlogo.cn/g?b=qq&nk={$blog.qq}&s=160">
                        </a>
                        <div class="media-body">
                            <a href="../Home/user_data.html?name={$blog.name}">
                                {$blog.name}
                            </a>
                            <small class="text-muted text-success">{$blog.time}</small>
                        </div>
                    </div>
                    <div class="social-body">
                        <p>
                            {$blog.info}
                        </p>

                        <div class="btn-group">
                            <form action="" method="get" id="form1"></form>
                            <button class="btn btn-white btn-xs" onclick="zan_blog({$blog.Id})"><i
                                    class="fa fa-thumbs-up">{$blog.zan}</i> 赞
                            </button>
                            <button class="btn btn-white btn-xs" onclick="show({$blog.Id})"><i
                                    class="fa fa-comments"></i>评论
                            </button>
                            <button class="btn btn-white btn-xs"><i class="fa fa-share"></i> 分享</button>
                            {if condition="$blog.name==$person.name"}
                            <button class="btn btn-white btn-xs" onclick="delete_blog({$blog.Id})"><i
                                    class="fa fa-times"></i> 删除
                            </button>
                            {/if}

                        </div>
                    </div>
                    <div class="social-footer">

                        {volist name='blog.comment' id='comment'}
                        <div class="social-comment">
                            <a href="" class="pull-left">
                                <img alt="image" class="img-circle" src="http://q1.qlogo.cn/g?b=qq&nk={$comment.qq}&s=160">
                            </a>
                            <div class="media-body">
                                <a href="#">
                                    {$comment.name}
                                </a>
                                <br/>
                                {$comment.info}
                                {if condition="$comment['name']==$person['name']"}
                                <i onclick="delete_comment({$comment.Id})" style="color: red"
                                   class="pull-right fa fa-times"></i>
                                {/if}
                                <br/>
                                <i class="fa fa-thumbs-up" onclick="zan_comment({$comment.Id})">{$comment.zan}</i>
                                <small class="text-muted">{$comment.time}</small>
                            </div>
                        </div>
                        {/volist}
                        <div class="social-comment" id="text{$blog.Id}" hidden>
                            <a href="" class="pull-left">
                                <img alt="image" class="img-circle"
                                     src="http://q1.qlogo.cn/g?b=qq&nk={$person.qq}&s=160">
                            </a>
                            <div class="media-body">
                                <textarea class="form-control" placeholder="填写评论..." id="comment{$blog.Id}"
                                          name="info"></textarea>
                            </div>
                            <div align="right">
                                <button type="button" onclick="send_comment({$blog.Id})" class="btn btn-primary btn-xs">
                                    <i class="fa fa-check"></i>发表
                                </button>
                            </div>
                        </div>

                    </div>

                </div>
{/volist}
                <div class="text-center">
                    {$page}
                </div>
            </div>

        </div>
    </div>
</div>

{include file='blogpage/base/footer' /}
<script src="__PUBLIC__/home/js/layui/layui.all.js"></script>
<script src="__PUBLIC__/home/js/demo/blog.js"></script>
